====== Dataplot Plugin ====== ---- plugin ---- description: Plot tabular data using Gnuplot author : Yann Pouillon email : yann.pouillon@materialsevolution.es type : Syntax lastupdate : 2020-07-30 compatible : Hogfather, Greebo, Frusterick Manners, Elenor Of Tsort depends : conflicts : similar : Graphviz, Ditaa tags : media, images, data, plot, science downloadurl: https://github.com/pouillon/dataplot/archive/0.1.6.tar.gz bugtracker : https://github.com/pouillon/dataplot sourcerepo : https://github.com/pouillon/dataplot donationurl: http://amzn.com/w/1HNUX764BXIC0 screenshot_img : https://poupouille.org/images/dataplot-screenshot.png ---- This plugin creates plot images from tabular text data using the Gnuplot program. It supports exporting to OpenOffice through the [[odt|ODT Plugin]]. The underlying philosophy of Dataplot is to remain simple and minimalistic, thus offering a very small subset of Gnuplot's numerous features based on typical use cases. Its purpose is to offer a quick way to visualize tabular data on a wiki page. Feel free to develop your own plugin for more complicated scopes. For more information on Gnuplot refer to the [[http://www.gnuplot.info|Gnuplot documentation]]. This plugin is largely inspired from the [[plugin:graphviz|Graphviz plugin]] by Andreas Gohr. The main difference between the two plugins is that, in the present case, the code executed by Gnuplot is generated by the plugin, instead of being provided as input. ===== Download and Installation ===== :!: **External requirements:** This plugin requires the following additional components that must be installed separately: * [[http://cairographics.org/|Cairo]]; * [[http://www.gnuplot.info/|Gnuplot]] --- compiled with Cairo support. Pre-built packages fulfilling these conditions exist for most Linux distributions. Search and install the plugin using the [[plugin:extension|Extension Manager]]. Refer to [[:Plugins]] on how to install plugins manually. ===== Latest changes ===== {{rss>https://github.com/pouillon/dataplot/releases.atom date}} ===== Configuration ===== The full path to your Gnuplot binary must be configured in the config manager. By default, the plugin uses ''/usr/bin/gnuplot'' for the path. The images are then generated using the ''pngcairo'' terminal of Gnuplot, which is why you must use a version of Gnuplot built with Cairo support. ===== Examples/Usage ===== The most basic usage of Dataplot is for plotting a simple curve to visualize 2-column tabular data. This reads as follows: 0.0 0.0 1.0 1.0 2.0 4.0 3.0 9.0 With this syntax, all parameters are set to their defaults: Gnuplot's default size for the ''pngcairo'' terminal, i.e. 640x480 by the time this document is written, no smoothing of the curves, and drawing curves with linespoints. Here is another typical example of the use of this plugin for 2D plots, for multiple curves. The first column is always the horizontal coordinate, while each additional column represents an independent curve. 0.0 0.0 1.0 25.0 2 1.0 1.0 10.5 20.0 4 2.0 4.0 8.25 15.0 5 3.0 9.0 4.125 10.0 9 4.0 16.0 12.065 5.0 18 5.0 25.0 5.0325 0.0 23 In this example, Gnuplot is asked to plot 3 curves with smooth lines within a 600x400 image which will be centered horizontally on the wiki page. ===== Syntax ===== The ''dataplot'' tag and its options controls the plot parameters. Everything enclosed within a ... environment is interpreted as input data for Gnuplot and is supposed to be ordered column-wise. By providing keywords along with the ''dataplot'' tag in any order, the plot can be tweaked to a certain extent. The default line style of the plot is ''linespoints''. The available options are ''boxes'', ''lines'', ''linespoints'', and ''points''. The ''smooth'' keyword will smooth the curves with [[wp>Cubic_hermite_spline|csplines]]. The default is to draw straight lines between data points. You can also specify ''left'', ''center'' or ''right'' to align the resulting image. The default is ''left''. A parameter in the form of ''////x////'' is interpreted as wanted output size. To only specify width ''width=////'' or ''////x0'' can be used, for height ''height=////'' or ''0x////''. The plot axes can be labelled by using the ''xlabel="//text//"'' and ''ylabel="//text//"'' options. Please note that the labels must be double-quoted to be taken into account. You may also specify ranges for the plot through the ''xrange=//a:b//'' and ''yrange=//c:d//'' options. Please note that all interval borders must be specified as floating-point numbers to be taken into account. For example, ''xrange=//-1.0:1.0//'' will indeed affect the plot X-axis, while ''xrange=//-1:1//'' will be silently ignored. ===== Configuration and Settings ===== The only configurable parameter of this plugin is the path to the Gnuplot binary, which defaults to ''/usr/bin/gnuplot'' and can be changed through the config manager. === Known Bugs and Issues === Please report bugs to [[https://bugs.launchpad.net/dataplot|the Launchpad Project Page for Dataplot]]. === ToDo/Wish List === Here are the desirable features planned for the next versions of this plugin: * read several independent (X,Y) datasets as pairs of columns; * allow for parametric plots; * allow for 3D plots. You can ask for more features by submitting bugs to [[https://bugs.launchpad.net/dataplot|the Launchpad Project Page for Dataplot]]. ===== FAQ ===== ==== Why Gnuplot and not another plotting program? ==== Gnuplot is an element of choice to render images on a wiki, both because of its versatility and its very high scriptability. They give the plugin a lot of flexibility and adaptability, which is a clear advantage when the needs of users constantly change with time. ==== Why using ''pngcairo'' instead of the more basic ''png'' terminal of Gnuplot? ==== The ''pngcairo'' terminal provides a significantly better rendering quality than the ''png'' one, as well as a ''dashed'' option which is very useful to generate print-quality black-and-white documents and for color-blind people. The improvement of the user experience and the extension to a larger audience is really worth the little burden a webmaster may have to go through when installing the plugin. ==== Why not letting the user directly provide a Gnuplot script? ==== Since Gnuplot can execute arbitrary shell commands, this would create a very high security risk for the server. This is why the plugin generates the Gnuplot script from a strictly controlled subset of Gnuplot commands. ===== Discussion ===== Not yet. Feel free to start one.